{
  "swagger": "2.0",
  "info": {
    "title": "Gist Fox API",
    "version": "",
    "description": "Gist Fox API is a **pastes service** similar to [GitHub's Gist](http://gist.github.com).\n\n## Authentication\n\n*Gist Fox API* uses OAuth Authorization. First you create a new (or acquire existing) OAuth token using Basic Authentication. After you have acquired your token you can use it to access other resources within token' scope.\n\n## Media Types\n\nWhere applicable this API uses the [HAL+JSON](https://github.com/mikekelly/hal_specification/blob/master/hal_specification.md) media-type to represent resources states and affordances.\n\nRequests with a message-body are using plain JSON to set or update resource states.\n\n## Error States\n\nThe common [HTTP Response Status Codes](https://github.com/for-GET/know-your-http-well/blob/master/status-codes.md) are used."
  },
  "paths": {
    "/": {
      "get": {
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Link": {
                "type": "string"
              }
            },
            "examples": {
              "application/hal+json": {
                "_links": {
                  "self": {
                    "href": "/"
                  },
                  "gists": {
                    "href": "/gists?{since}",
                    "templated": true
                  },
                  "authorization": {
                    "href": "/authorization"
                  }
                }
              }
            },
            "schema": {
              "type": "object",
              "properties": {
                "_links": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "object",
                      "properties": {
                        "href": {
                          "type": "string"
                        }
                      }
                    },
                    "gists": {
                      "type": "object",
                      "properties": {
                        "href": {
                          "type": "string"
                        },
                        "templated": {
                          "type": "boolean"
                        }
                      }
                    },
                    "authorization": {
                      "type": "object",
                      "properties": {
                        "href": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              },
              "example": {
                "_links": {
                  "self": {
                    "href": "/"
                  },
                  "gists": {
                    "href": "/gists?{since}",
                    "templated": true
                  },
                  "authorization": {
                    "href": "/authorization"
                  }
                }
              }
            }
          }
        },
        "summary": "Retrieve the Entry Point",
        "operationId": "Retrieve the Entry Point",
        "description": "",
        "tags": [],
        "parameters": [],
        "produces": [
          "application/hal+json"
        ],
        "consumes": []
      }
    },
    "/gists/{id}": {
      "get": {
        "responses": {
          "200": {
            "description": "HAL+JSON representation of Gist Resource. In addition to representing its state in the JSON form it offers affordances in the form of the HTTP Link header and HAL links.",
            "headers": {
              "Link": {
                "type": "string"
              }
            },
            "examples": {},
            "schema": {
              "$ref": "#/definitions/GistModel"
            }
          }
        },
        "summary": "Retrieve a Single Gist",
        "operationId": "Retrieve a Single Gist",
        "description": "",
        "tags": [
          "Gist"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID of the Gist in the form of a hash.",
            "required": true,
            "type": "string"
          },
          {
            "name": "access_token",
            "in": "query",
            "description": "Gist Fox API access token.",
            "required": false,
            "type": "string"
          }
        ],
        "consumes": []
      },
      "patch": {
        "responses": {
          "200": {
            "description": "HAL+JSON representation of Gist Resource. In addition to representing its state in the JSON form it offers affordances in the form of the HTTP Link header and HAL links.",
            "headers": {
              "Link": {
                "type": "string"
              }
            },
            "examples": {},
            "schema": {
              "$ref": "#/definitions/GistModel"
            }
          }
        },
        "summary": "Edit a Gist",
        "operationId": "Edit a Gist",
        "description": "To update a Gist send a JSON with updated value for one or more of the Gist resource attributes. All attributes values (states) from the previous version of this Gist are carried over by default if not included in the hash.",
        "tags": [
          "Gist"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID of the Gist in the form of a hash.",
            "required": true,
            "type": "string"
          },
          {
            "name": "access_token",
            "in": "query",
            "description": "Gist Fox API access token.",
            "required": false,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "content": {
                  "type": "string"
                }
              },
              "example": {
                "content": "Updated file contents"
              }
            }
          }
        ],
        "consumes": [
          "application/json"
        ]
      },
      "delete": {
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {},
            "examples": {}
          }
        },
        "summary": "Delete a Gist",
        "operationId": "Delete a Gist",
        "description": "",
        "tags": [
          "Gist"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID of the Gist in the form of a hash.",
            "required": true,
            "type": "string"
          },
          {
            "name": "access_token",
            "in": "query",
            "description": "Gist Fox API access token.",
            "required": false,
            "type": "string"
          }
        ],
        "consumes": []
      }
    },
    "/gists": {
      "get": {
        "responses": {
          "200": {
            "description": "HAL+JSON representation of Gist Collection Resource. The Gist resources in collections are embedded. Note the embedded Gists resource are incomplete representations of the Gist in question. Use the respective Gist link to retrieve its full representation.",
            "headers": {
              "Link": {
                "type": "string"
              }
            },
            "examples": {
              "application/hal+json": {
                "_links": {
                  "self": {
                    "href": "/gists"
                  }
                },
                "_embedded": {
                  "gists": [
                    {
                      "_links": {
                        "self": {
                          "href": "/gists/42"
                        }
                      },
                      "id": "42",
                      "created_at": "2014-04-14T02:15:15Z",
                      "description": "Description of Gist"
                    }
                  ]
                },
                "total": 1
              }
            },
            "schema": {
              "$ref": "#/definitions/Gists CollectionModel"
            }
          }
        },
        "summary": "List All Gists",
        "operationId": "List All Gists",
        "description": "",
        "tags": [
          "Gist"
        ],
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "description": "Timestamp in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ` Only gists updated at or after this time are returned.",
            "required": false,
            "type": "string"
          }
        ],
        "produces": [
          "application/hal+json"
        ],
        "consumes": []
      },
      "post": {
        "responses": {
          "201": {
            "description": "HAL+JSON representation of Gist Resource. In addition to representing its state in the JSON form it offers affordances in the form of the HTTP Link header and HAL links.",
            "headers": {
              "Link": {
                "type": "string"
              }
            },
            "examples": {},
            "schema": {
              "$ref": "#/definitions/GistModel"
            }
          }
        },
        "summary": "Create a Gist",
        "operationId": "Create a Gist",
        "description": "To create a new Gist simply provide a JSON hash of the *description* and *content* attributes for the new Gist.\n\nThis action requires an `access_token` with `gist_write` scope.",
        "tags": [
          "Gist"
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "query",
            "description": "Gist Fox API access token.",
            "required": false,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "description": {
                  "type": "string"
                },
                "content": {
                  "type": "string"
                }
              },
              "example": {
                "description": "Description of Gist",
                "content": "String content"
              }
            }
          }
        ],
        "consumes": [
          "application/json"
        ]
      }
    },
    "/gists/{id}/star": {
      "put": {
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {},
            "examples": {}
          }
        },
        "summary": "Star a Gist",
        "operationId": "Star a Gist",
        "description": "This action requires an `access_token` with `gist_write` scope.",
        "tags": [
          "Gist"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID of the gist in the form of a hash",
            "required": true,
            "type": "string"
          },
          {
            "name": "access_token",
            "in": "query",
            "description": "Gist Fox API access token.",
            "required": false,
            "type": "string"
          }
        ],
        "consumes": []
      },
      "delete": {
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {},
            "examples": {}
          }
        },
        "summary": "Unstar a Gist",
        "operationId": "Unstar a Gist",
        "description": "This action requires an `access_token` with `gist_write` scope.",
        "tags": [
          "Gist"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID of the gist in the form of a hash",
            "required": true,
            "type": "string"
          },
          {
            "name": "access_token",
            "in": "query",
            "description": "Gist Fox API access token.",
            "required": false,
            "type": "string"
          }
        ],
        "consumes": []
      },
      "get": {
        "responses": {
          "200": {
            "description": "HAL+JSON representation of Star Resource.",
            "headers": {
              "Link": {
                "type": "string"
              }
            },
            "examples": {},
            "schema": {
              "$ref": "#/definitions/StarModel"
            }
          }
        },
        "summary": "Check if a Gist is Starred",
        "operationId": "Check if a Gist is Starred",
        "description": "",
        "tags": [
          "Gist"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID of the gist in the form of a hash",
            "required": true,
            "type": "string"
          },
          {
            "name": "access_token",
            "in": "query",
            "description": "Gist Fox API access token.",
            "required": false,
            "type": "string"
          }
        ],
        "consumes": []
      }
    },
    "/authorization": {
      "get": {
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Link": {
                "type": "string"
              }
            },
            "examples": {},
            "schema": {
              "$ref": "#/definitions/AuthorizationModel"
            }
          }
        },
        "summary": "Retrieve Authorization",
        "operationId": "Retrieve Authorization",
        "description": "",
        "tags": [
          "Access Authorization and Control"
        ],
        "parameters": [],
        "consumes": [],
        "security": [
          {
            "basic": []
          }
        ]
      },
      "post": {
        "responses": {
          "201": {
            "description": "Created",
            "headers": {},
            "examples": {}
          }
        },
        "summary": "Create Authorization",
        "operationId": "Create Authorization",
        "description": "",
        "tags": [
          "Access Authorization and Control"
        ],
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "scopes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "scopes": [
                  "gist_write"
                ]
              }
            }
          }
        ],
        "consumes": [
          "application/json"
        ],
        "security": [
          {
            "basic": []
          }
        ]
      },
      "delete": {
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {},
            "examples": {}
          }
        },
        "summary": "Remove an Authorization",
        "operationId": "Remove an Authorization",
        "description": "",
        "tags": [
          "Access Authorization and Control"
        ],
        "parameters": [],
        "consumes": [],
        "security": [
          {
            "basic": []
          }
        ]
      }
    }
  },
  "definitions": {
    "Gist Fox API Root": {},
    "Gist": {},
    "GistModel": {},
    "Gists Collection": {},
    "Gists CollectionModel": {
      "type": "object",
      "properties": {
        "_links": {
          "type": "object",
          "properties": {
            "self": {
              "type": "object",
              "properties": {
                "href": {
                  "type": "string"
                }
              }
            }
          }
        },
        "_embedded": {
          "type": "object",
          "properties": {
            "gists": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "_links": {
                    "type": "object",
                    "properties": {
                      "self": {
                        "type": "object",
                        "properties": {
                          "href": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "id": {
                    "type": "string"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "total": {
          "type": "number"
        }
      },
      "example": {
        "_links": {
          "self": {
            "href": "/gists"
          }
        },
        "_embedded": {
          "gists": [
            {
              "_links": {
                "self": {
                  "href": "/gists/42"
                }
              },
              "id": "42",
              "created_at": "2014-04-14T02:15:15Z",
              "description": "Description of Gist"
            }
          ]
        },
        "total": 1
      }
    },
    "Star": {},
    "StarModel": {},
    "Authorization": {},
    "AuthorizationModel": {}
  },
  "securityDefinitions": {
    "basic": {
      "type": "basic"
    }
  },
  "tags": [
    {
      "name": "Gist",
      "description": "Gist-related resources of *Gist Fox API*."
    },
    {
      "name": "Access Authorization and Control",
      "description": "Access and Control of *Gist Fox API* OAuth token."
    }
  ]
}